<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>申请调动</title>
</head>
<body>
	<script type="text/javascript">
	function quxiao(){
		add("ljj-transfer");		
	}
	$(function(){
		//多选框获取值
		 $("input[name='transfertypesName']:checkbox").click(function () {
	           var flag = $(this).is(':checked');
	           if (flag) {
	               $(this).siblings("input").attr("checked", false);
	           }
	       });
		 //选中名称,使用ajax传值
		/*  $("#staff-name").selectchange(function(){
			 alert(1);
			 $("#become-table").show();
			 	var id=$(".textbox-value").val();
					  $.ajax({
				         type:"post",//type可以为post也可以为get
				         url:"transfers-name",
				         data:{id:id},
				         success:function(data){
				        	 $("#become-table").datagrid("reload");
				             $("#becomeaa").window("close");
				         }
				     });
		 }); */
		 //选中下拉框
		 $("#transfer-btable").css('display','none');
   		 $("#staff-name").combogrid({
   	   		onChange:function(staff_id){
   	   			$("#transfer-dd").form('load','transfers-name?staff_id='+staff_id);
   	   			alert("oldval=="+staff_id);
   	   			$("#transfer-btable").css('display','block');
   	   		}
   			 
   		 })
   		 
   		 $("#rank-qianding").click(function(){
   			 alert($("#departName").combogrid("getValue"));
   			 alert($("#jobchageName").combogrid("getValue"));
   			 alert($("#position_id").combogrid("getValue"));
   			$("#transfer-dd").submit();
			$("#transfer-dd").form("clear");
   			 $("#depart_id").combogrid("getValue");
   			 $("#jobchage_id").combogrid("getValue");
   			 $("#positionId").combogrid("getValue");
   			 //调动后
   			 $("#departName").combogrid("getValue");
   			 $("#jobchageName").combogrid("getValue");
   			 $("#position_id").combogrid("getValue");
   			 
   			 //自动增编号
   			$("#transfer_id").combogrid("getValue");
   			$("#transfertypesId").combogrid("getValue");
   			$("#approval_id").combogrid("getValue");
   			$("#transferjl_id").combogrid("getValue");
   		 })
	});
	</script>
	<div>
			<Form action="insert-transfer" id="transfer-dd" method="post">
				<div style="text-align: center;font-size: 22px;">
				<p>申请调动</p>
				</div>
				<div style="margin:0 auto;border:1px solid red;width: 800px;">
				</div>
		        <table width="600px" style="padding: 40px 5px 2px 3px;margin: 0 auto;height: 200px;font-size: 18px">
		        		<tr>
		        			<!-- <td><input id="transfer_id"  name="transfer_id" class="easyui-textbox" data-options="label:'调动编号',width:280,labelAlign:'right',required:true"/></td> -->
		        			<td><select  id="staff-name" class="easyui-combogrid" 
									name="staffId"
						    	data-options="
						    	label:'调动员工',
						    	width:280,
						    	labelAlign:'right',
						    	required:true,
							    panelWidth:200,
							    idField:'staff_id',
							    textField:'staff_name',
							    url:'staffbg-list',
							    columns:[[
							    {field:'staff_id',title:'员工工号',width:60},
							    {field:'staff_name',title:'员工名称',width:120},
							    ]]
						    "></select></td>
		        		</tr>
		        		<tr>
		        		<!-- 类型编号 -->
		        		<td><input  name="transfertypesId" class="easyui-textbox" data-options="label:'类型编号',width:280,labelAlign:'right',required:true"/></td>
		        		</tr>
		        		<tr>
		        			<td><input  name="approval_time" class="easyui-datebox" data-options="label:'生效日期',width:280,labelAlign:'right',required:true,editable:false"/></td>
							<td>
				        			&nbsp;调动类型<input type="checkbox" name="transfertypesName" value="调岗" />调岗
				                    <input type="checkbox" name="transfertypesName" value="晋升" />晋升
				                    <input type="checkbox" name="transfertypesName" value="降级" />降级
							</td>
						</tr>
		        	</table>
		        	
		        	<!-- 选中员工名称弹出调动前后表格 -->
		 <div id="transfer-btable" style="margin-left:280px;height: 300px">
				<div id="ddq-bm" style="line-height: 50px;">
							<input name="depart_id" id="depart_id" type="hidden" >
							<input  name="depart_name" class="easyui-textbox" data-options="label:'原部门',width:280,labelAlign:'right',required:true"/>
							<select  id="departName" class="easyui-combogrid" 
									name="departNamea"
						    	data-options="
						    	label:'调动后部门',
						    	width:280,
						    	labelAlign:'right',
						    	required:true,
							    panelWidth:200,
							    idField:'depart_id',
							    textField:'departName',
							    url:'Department_list',
							    columns:[[
							    {field:'depart_id',title:'部门编号',width:60},
							    {field:'departName',title:'部门名称',width:120},
							    ]],
							    pagination:true,
				    		    pageNumber:1,
				    		    pageSize:2,
				    		    pageList:[2,5]
						    "></select>
				</div>
				<div id="ddq-bm2" style="line-height: 50px;">
							<input name="jobchage_id" id="jobchage_id" type="hidden" >
							<input  name="jobchage_name" class="easyui-textbox" data-options="label:'原职务',width:280,labelAlign:'right',required:true"/>
							<select  id="jobchageName" class="easyui-combogrid" 
									name="jobchageNamea"
						    	data-options="
						    	label:'调动后职务',
						    	width:280,
						    	labelAlign:'right',
						    	required:true,
							    panelWidth:200,
							    idField:'jobchageId',
							    textField:'jobchageName',
							    url:'jobchage_list',
							    columns:[[
							    {field:'jobchageId',title:'职务编号',width:60},
							    {field:'jobchageName',title:'职务名称',width:120},
							    ]],
							    pagination:true,
				    		    pageNumber:1,
				    		    pageSize:2,
				    		    pageList:[2,5]
						    "></select>
				</div>
				<div id="ddq-bm3" style="line-height: 50px;">
							<input name="positionId" id="positionId" type="hidden" >
						    <input  name="positionName" class="easyui-textbox" data-options="label:'原职位',width:280,labelAlign:'right',required:true"/>
							<select  id="position_id" class="easyui-combogrid" 
									name="position_name"
						    	data-options="
						    	label:'调动后职位',
						    	width:280,
						    	labelAlign:'right',
						    	required:true,
							    panelWidth:300,
							    idField:'position_id',
							    textField:'position_name',
							    url:'ps',
							    columns:[[
							    {field:'position_id',title:'职位编号',width:60},
							    {field:'position_name',title:'职位名称',width:100},
							    {field:'position_ms',title:'职位描述',width:120},
							    ]]
						    "></select>
				</div>
		</div>
						<!-- 审批编号 -->
			 				<input name="approval_id" id="approval_id" >
			 			<!-- 记录编号 -->
							<input name="transferjl_id" id="transferjl_id" >
		        	<div style="text-align: center;margin: 10px 1px 1px 1px;">
					<a id="transfer-gb" onclick="quxiao()" class="easyui-linkbutton" data-options="width:100">返回</a>
					<a id="rank-qianding"  class="easyui-linkbutton" data-options="width:100">保存</a>
					</div>
				 </Form>
	</div>
</body>
</html>